/**
 * 
 */
package org.xelnaga.defiler.web.macro.variable;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.web.util.WebUtils;

/**
 * @author qijb
 *
 */
public class CommonMacroHelper {
	private HttpServletRequest request;
	/**
	 * @param request 
	 * 
	 */
	public CommonMacroHelper(HttpServletRequest request) {
		this.request = request;
	}

	public Cookie getCookie(String name) {
		if(StringUtils.isNotBlank(name)) {
			return WebUtils.getCookie(request, name);
		}
		return null;
	}
}
